﻿using SQLite;

namespace Klear.Library.Models;

[Table("income_expenses")] // 表名
public class IncomeAndExpensesModel
{
    [PrimaryKey, AutoIncrement] // 主键，自动递增
    public int Id { get; set; }
        
    [Column("title"), NotNull] // 标题
    public string Title { get; set; } = string.Empty;
        
    [Column("amount"), NotNull] // 金额
    public decimal Amount { get; set; }
        
    [Column("category"), NotNull] // 分类
    public string Category { get; set; } = string.Empty;
        
    [Column("notes")] // 备注
    public string Notes { get; set; } = string.Empty;
    
    [Column("year_and_month")]
    public DateTime YearAndMonth { get;  } = DateTime.Now;      //所属年月，不可修改字段
    [Column("create_time")]
    public DateTime CreateTime { get; set; } = DateTime.Now;    //创建日期
    [Column("update_time")]
    public DateTime UpdateTime { get; set; } = DateTime.Now;//修改日期
}